<template>
  <view class="container">
    <!-- 搜索 -->
    <LocationCalendar page="search"/>
    <!-- 内容区域 -->
    <view class="content">
      <view class="main">
        <!-- 搜索到的内容 -->
        <view class="search-content">
          <view class="">
            <SwitchTab />
            <ProductItem />
          </view>
          <Empty />
        </view>
        <!-- 历史搜索 -->
        <view class="history">
          <view class="h-tit"> 历史搜索 </view>
          <view class="h-list">
            <view class="h-item" v-for="item in 3" :key="item">
              <view class="h-left">
                <image src="../../static/icon/home/history.png"></image>
                <view class="h-name"> 咖啡店 </view>
              </view>
              <uni-icons type="closeempty" size="16"></uni-icons>
            </view>
          </view>
        </view>
        <!-- 热门推荐 -->
        <view class="recomm">
          <view class="r-tit"> 热门推荐 </view>
          <view class="r-list">
            <view class="r-item" v-for="item in 7" :key="item"> 森林过夜 </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
  import { computed, ref } from 'vue';
  import Empty from '@/components/Empty.vue';
  import LocationCalendar from '@/components/LocationCalendar.vue';
  import SwitchTab from '@/components/SwitchTab.vue';
  import ProductItem from '@/components/ProductItem.vue'
  const { safeAreaInsets } = uni.getSystemInfoSync()
  const padTop = computed(() => {
    return safeAreaInsets.top + 13 + 'px'
  })
  const search = () => {
  }
  const goBack = () => {
    uni.navigateBack()
  }
</script>

<style lang="scss" scoped>
  .container {
    .top-search {
      padding: 0 12px;
      box-sizing: border-box;
      height: 200px;
      width: 100%;
      background: url('../../static/icon/components/home-top.png') no-repeat center center;
      background-size: 100% 100%;
      .location-calendar {
        height: 44px;
        color: #333333;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .location {
          font-size: 16px;
          image {
            width: 18px;
            margin-right: 10px;
          }
          .txt {
            display: inline-block;
            width: 176px;
            font-weight: bold;
            line-height: 19px;
            white-space:nowrap;
            text-overflow:ellipsis;
            overflow: hidden;
          }
        }
        .calendar {
          display: flex;
          align-items: center;
          width: 124px;
          height: 26px;
          border-radius: 5px;
          background-color: #FFFFFF80;
          border: 1px solid #FFFFFF;
          font-size: 12px;
          image {
            width: 24px;
            height: 24px;
          }
        }
        }
        .logo-box {
          font-size: 14px;
          color: #FF3B1EFF;
          display: flex;
          align-items: end;
          .logo {
            width: 56px;
            height: 31px;
            background: url('../../static/icon/home/logo.png') no-repeat center center;
            background-size: 100% 100%;
            margin-right: 9px;
          }
          image {
            width: 56px;
            height: 31px;
        }
      }
      .search-box {
        display: flex;
        align-items: center;
        .search {
          margin-left: 6px;
          flex: 1;
          height: 32px;
          display: flex;
          align-items: center;
          justify-content: space-between;
          font-size: 14px;
          margin-top: 6px;
          padding: 0 2px 0 10px;
          border-radius: 170px;
          border: 1px solid rgba(255,59,30,0.5);
          box-sizing: border-box;
          input {
            flex: 1;
            margin: 0 10px;
          }
          .search-btn {
            color: #fff;
            width: 44px;
            height: 28px;
            font-weight: 400;
            text-align: center;
            line-height: 28px;
            background-color: #FF3B1E;
            border-radius: 139px 139px 139px 139px;
          }
        }
      }
    }
    // 内容区域
    .content {
      transform: translateY(-33px);
      background-color: #F6F6F6;
      padding: 20px 12px;
      .main {
        // 历史搜索
        .history {
          padding: 0 4px;
          box-sizing: border-box;
          .h-tit {
            height: 19px;
            font-weight: bold;
            font-size: 16px;
            color: #333333;
            line-height: 19px;
          }
          .h-list {
            .h-item {
              height: 50px;
              border-bottom: 1px solid #E6E6E6;
              display: flex;
              justify-content: space-between;
              align-items: center;
              .h-left {
                display: flex;
                align-items: center;
                image {
                  width: 16px;
                  height: 16px;
                  margin-right: 8px;
                }
                .h-name {
                  height: 16px;
                  font-weight: 400;
                  font-size: 14px;
                  color: #666666;
                  line-height: 16px;
                }
              }
            }
            
          }
        }
        // 热门推荐
        .recomm {
          margin-top: 21px;
          padding: 0 4px;
          box-sizing: border-box;
          .r-tit {
            height: 19px;
            font-weight: bold;
            font-size: 16px;
            color: #333333;
            line-height: 19px;
          }
          .r-list {
            margin-top: 19px;
            .r-item {
              display: inline-block;
              height: 28px;
              font-size: 14px;
              color: #666666;
              padding: 0 6px;
              margin-right: 10px;
              margin-bottom: 8px;
              line-height: 28px;
              background: #F0F0F0;
              box-sizing: border-box;
              border-radius: 4px 4px 4px 4px;
            }
          }
        }
      }
    }
  }
</style>